import { Login } from "@/api/interface/index";
import { PORT1 } from "@/api/config/servicePort";
import { obj2fd } from "@/utils/index";
import http from "@/api";
// 查询列表
export const getDataByPage = (params: object) => {
  return http.get(PORT1 + `/secure/fingList`, params); // 正常 post json 请求  ==>  application/json
};
// 获取协议列表
export const getAppData = () => {
  return http.get(PORT1 + `/secure/getAppList`); // 正常 post json 请求  ==>  application/json
};
// 新增
export const addData = (params: object) => {
  return http.post(PORT1 + `/secure/fingAdd`, params, { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 更新
export const editData = (params: object) => {
  return http.post(PORT1 + `/secure/fingUpdate`, params, { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 删除列表
export const deleteData = (params: object) => {
  return http.post(PORT1 + `/secure/fingDel`, params, { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 下载模板
export const downloadTemplate = (params: object) => {
  return http.post(PORT1 + `/secure/fingTemplate`, params, { loading: false, responseType: "blob" }); // 正常 post json 请求  ==>  application/json
};
// 导入
export const importData = (params: object) => {
  return http.post(PORT1 + `/secure/fingImport`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 导出
export const exportData = () => {
  return http.get(PORT1 + `/secure/fingExport`,{}, { loading: false, responseType: "blob" }); // 正常 post json 请求  ==>  application/json
};
